/* GUI CONVERTED from rswmd.p (converter v1.76) Thu Dec  6 07:57:07 2001 */
/* rswmd.p - Release Management Supplier Schedules                            */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.4 $                                                           */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3    LAST MODIFIED: 03/18/93      BY: WUG *G776*               */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00      BY: *N0KP* Mark Brown        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.4 $    BY: Jean Miller           DATE: 12/05/01  ECO: *P03B*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* SUBPROGRAM TO CALCULATE THE MONDAY DATE ON OR BEFORE,
   OR ON OR AFTER THE INPUT DATE */

define input parameter input_date as date.
define input parameter before as log.
define output parameter week_mon_dt as date.

if before then
   week_mon_dt = input_date - ((weekday(input_date) + 5) modulo 7).
else
   week_mon_dt = input_date + ((9 - weekday(input_date)) modulo 7).
